<template>
    <div style="width: unset;">
        <div class="posts" v-for="(item, index) in postList" :key="index">
            <el-header>
                <el-avatar>
                    <img v-if="item.avatar!=''" :src="require('../../../../server/public/images/class/' + item.avatar + '.jpg')" alt="">
                </el-avatar>
                <div class="post-title">
                    <p class="text-h2">{{item.name}}</p>
                    <span class="text1">{{item.ct}}</span>
                </div>
                <div class="tools">
                    <button class="text-a">已关注</button>
                    <img src="@/assets/images/操作.png" alt="">
                </div>
            </el-header>
            <div>
                <p class="content">{{item.content}}</p>
                <div class="imgbox">
                    <el-image v-for="(o, i) in item.img" :key="i" :src="require('../../../../server/public/images/class/' + o +  '.jpg')" ></el-image>
                </div>
            </div>
            <el-footer>
                <div>
                    <img src="@/assets/images/看过.png" alt=""><span>{{item.pageview}}</span>
                </div>
                <div>
                    <img src="@/assets/images/喜欢.png" alt=""><span>{{item.love}}</span>
                    <img src="@/assets/images/收藏.png" alt=""><span>{{item.collect}}</span>
                    <img src="@/assets/images/评论.png" alt=""><span class="last">{{item.comments}}</span>
                </div>
            </el-footer>
        </div>
    </div>
</template>

<script>
export default {
    name: 'WorkspaceJsonCommunityFocus',

    data() {
        return {
            postList: [
                {
                    id: 1, 
                    avatar: '春天', 
                    name: '测试', 
                    ct: '1小时前', 
                    content: '测试文字test测试文字test测试文字test测试文字test测试文字test测试文字test测试文字test测试文字test测试文字test测试文字test', 
                    img: ['春天'],
                    pageview: 243,
                    love: 234,
                    collect: 42334,
                    comments: 4634,
                },
                {
                    id: 2, 
                    avatar: '玫瑰',
                    name: '玫瑰', 
                    ct: '2小时前', 
                    content: '花开，花落，便是一生。', 
                    img: ['玫瑰'], 
                    pageview: 3412,
                    love: 23523,
                    collect: 456,
                    comments: 12312,
                },

            ]
        };
    },

    mounted() {
        
    },

    methods: {
        
    },
};
</script>

<style scoped>

</style>